module.exports = () => {
  const mongoose = require('mongoose')
  mongoose.set('useFindAndModify', false)
  mongoose.connect('mongodb://127.0.0.1:27017/vue-node-copy', { useUnifiedTopology: true, useNewUrlParser: true })
    .then(() => { console.log('数据库连接成功') })
    .catch(err => {
      console.log(err)
    })
  //把某一文件夹的文件引入进来
  require('require-all')(__dirname +'/../models')
}